import request from "@/utils/request";

// 分页查询用户（使用 page 和 limit）
export const _getUserPage = (queryDto) => request.get('/api/user/page', { params: queryDto })

// 查询所有角色
export const _getRoles = () => request.get('/api/role/list')

// 根据id删除用户
export const _deleteUser = (id) => request.delete('/api/user/delete?id=' + id)

// 根据id获取用户
export const _getUserById = (id) => request.get('/api/user/getById?id=' + id)

// 更新用户
export const _updateUser = (user) => request.put('/api/user/update', user)

// 新增用户
export const _saveUser = (user) => request.post('/api/user/save', user)

// 获取用户列表（不分页）
export const _getUserList = () => request.get('/api/user/list')

export const _login = (user) => request.post('/api/acc/login', user)

// 退出登录
export const _logout = () => request.get('/api/acc/logout')

// 重置密码
export const _resetPassword = (user) => request.post('/api/user/resetPassword', user)

// 根据角色获取用户列表（学院列表）
export const _getUserByRole = () => request.get('/api/user/getUserByRole')

// 获取当前登录用户信息
export const _getCurrentUser = () => request.get('/api/user/getCurrentUser')